{extend name='admin@public/content'}

{block name="button"}
{if auth("$classuri/add")}
<button data-modal='{:url("$classuri/add")}' data-title="添加标签" class='layui-btn layui-btn-sm layui-btn-primary'>添加标签</button>
{/if}

{if auth("$classuri/del")}
<button data-update data-field='delete' data-action='{:url("$classuri/del")}' class='layui-btn layui-btn-sm layui-btn-primary'>删除标签</button>
{/if}

{/block}

{block name="content"}

<form onsubmit="return false;" data-auto="" method="POST">
    <!--tag_list-->
    {if isset($tag_list) && $tag_list != null}
    {foreach $tag_list as $key=>$item}
    <table class="layui-table notevent" lay-skin="line">
        <thead>
            <tr>
                <th colspan="8"><input data-none-auto="" data-check-target='.list-check_{$key}' type='checkbox'/>&nbsp;{$item.name}</th>
            </tr>
        </thead>
        <tbody>
            {foreach $item.tags as $tags}
            <tr>
                {foreach $tags as $tag}
                <td class="tag_item">
                    <input class="list-check-box list-check_{$key}" value='{$tag.id}' type='checkbox'/>
                    <a data-modal='{:url("$classuri/edit")}?id={$tag.id}' href="javascript:void(0)">&nbsp;{$tag.name}</a>
                </td>
                {/foreach}
            </tr>
            {/foreach}
        </tbody>
    </table>
    {/foreach}
    {/if}
</form>
{/block}
